#pragma once
#ifndef _PACKET_PROCESS_H_
#define _PACKET_PROCESS_H_

extern net::network_t g_netHandle;
extern net::IMessageQueue* g_pMsgQueue;

struct MessageHeader
{
	xgc_uint32 seq;
	xgc_uint16 cmd;
	xgc_uint16 length;
};

///initialize network
void PrepareNetEnv();
void DestoryNetEnv();

bool ConnectSvr();
void ProcessPacket( net::INetPacket* pPacket );

///Process Internal Packet;
void ProcessConnect(net::network_t h);
void ProcessClose( net::network_t h, xgc_lpvoid userdata );
void ProcessError( net::network_t h, int e );

///Process command response
void Process_Response( net::network_t h, MessageHeader head, const xgc_byte* data, xgc_uint32 size, xgc_lpvoid u );

void Process_Login( net::network_t h, const xgc_byte* data, xgc_uint32 size, xgc_lpvoid u );
void Process_ActInfo( net::network_t h, const xgc_byte* data, xgc_uint32 size, xgc_lpvoid u );

#endif // _PACKET_PROCESS_H_